var jsonList = {};
var page = 1;
var rows = 10;
$(function (){
    getList();
})
function getLocalTime(nS) {
    return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' ');
}
function getList() {
    var result = JSON.stringify(jsonList);
    $.ajax({
        url: baseNews + "/api/data/sys/log/list?page=" + page + "&rows=" + rows,
        type: "post",
        headers: { 'Content-Type': 'application/json' },
        dataType: "json",
        data: result,
        success: function (res) {
            console.log(res, 666);
            if (res.code == 0) {
                var result = res.data;
                var list = result.list;
                console.log(list, 9999)
                var html = "";
                $("#page").paging({
                    pageNo: page,
                    totalPage: result.totalpage,
                    totalSize: result.totals,
                    callback: function (num) {
                        page = num;
                        getList();
                    }
                })
               $(".mlists").empty();
                $(list).each(function (index, key) {
                
                    html += `<div class="main mains">
			    <div class="main-top matop">
					<div class="main-left">${getLocalTime(key.time/1000)}</div>
					<div class="main-left main-cen">${key.level}</div>
					<div class="main-left main-righ zi" style="overflow:hidden">${key.content}</div>
				</div>
			</div>`;
                })
                $(".mlists").append(html);
            }
        }

    })
    //分页

}